<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>属性选择器</title>
        <style type="text/css">
            div[name^="div"]{
                color:red;
            }
            div[name$="1"]{
                font-size:3em;
            }
            div[name="middlediv"]{
                color:blue;
            }
            div[name*="div"]{
                margin:10px;
                border:1px solid #ff0000;
            }
            [name$="1"]{
                background:rgb(211, 239, 240);
            }
        </style>
    </head>
    <body>
        <header name="header1">header</header>
        <div name="div1">div1</div>
        <div name="div2">div2</div>
        <div name="middlediv">middle div</div>
        <div name="mydiv1">mydiv1</div>
        <div name="mydiv2">mydiv2</div>
    </body>
</html>